#!/bin/bash
# 获取当前时间并加上8小时
current_time=$(date -d '+8 hours' '+%Y%m%d%H')
echo "Current time: $current_time"
echo "WORKSPACE $WORKSPACE"

# 设置工作目录
work_space="$WORKSPACE";

# 检查参数并执行相应操作
case "$buildtype" in
  "all")
    echo "Selected workscope is all"
    node -v
    npm -v
    npm install
    npm run build:h5
    cd dist/build/h5
    tar -zcf "web_$current_time.tar.gz" *
    ;;
  "web")
    echo "Selected workscope is web"
    node -v
    npm -v
    npm run build:h5
    cd dist/build/h5
    tar -zcf "web_$current_time.tar.gz" *
    ;;
  *)
    echo "Selected workscope is empty"
    ;;
esac
